<template>
    <section class="indexScore">
        <PendingTask ref="PendingTask" :isReview = "'0'" @getCurrentTask="getCurrentTask" @getTaskIndex="getTaskIndex">
            <template slot-scope="props">
                <div :index="props.index" ref="task" v-if="props.index === taskIndex && isShowTaskDetail" class="scoreDiv">
                    <div v-if="currentObject.id">
                        <el-tabs v-model="activeTab" type="card"  @tab-click="handleTab">
                            <el-tab-pane :label="grandItem.quotaName" :name="grandItem.quotaId"
                                             v-for="(grandItem,grandIndex) in indexList" >
                                    <div>
                                        <div class="statusButtonDiv">
                                            <el-tag v-if="currentObject.status === '0'"  class="statusDiv" type="success" effect="dark">当前状态：待提交</el-tag>
                                            <el-tag v-else-if="currentObject.status === '1'" class="statusDiv" type="success" effect="dark">当前状态：待市委审核</el-tag>
                                            <el-tag v-else-if="currentObject.status === '2'" class="statusDiv" type="success" effect="dark">当前状态：待市委确认</el-tag>
                                            <el-tag v-else-if="currentObject.status === '3'"  class="statusDiv" type="success" effect="dark">当前状态：市委确认通过</el-tag>
                                            <el-button v-show="currentObject.status === '0'" :loading="submitBtnLoading" class="statusSubmit" @click="submit()">提交</el-button>
                                        </div>
                                        <div class="titleLeftIcon" >
                                            <span>指标打分</span>
                                        </div>
                                        <div class="handleContent" v-loading="cardLoad" >
                                            <marke-index :indexList="indexDataList" :currentObjStatus="currentObject.status" @makeMarker="editScore"></marke-index>
                                        </div>
                                    </div>
                                </el-tab-pane>
                        </el-tabs>
                    </div>
                </div>
            </template>
        </PendingTask>

        <el-dialog :title="diaTitle" :visible.sync="diaVis" v-if="diaVis" append-to-body :before-close="handClose" class="indexScoreDia">
            <div>
                <el-col :span="3">二级指标：</el-col>
                <el-col :span="21">{{secondIndex.quotaName}}<span style="color: red">&nbsp;&nbsp;({{secondIndex.quotaScore}}分)</span></el-col>
            </div>
            <el-row>
                <el-col :span="3">佐证材料：</el-col>
                <el-col :span="21">
                    <FileUpload :value="currentAttachment.address" @getValue="(val)=>{handleFile(val,currentAttachment)}" :disabled="diaDisabled"></FileUpload>
                </el-col>
            </el-row>
            <div class="otherInfo">
                <el-col :span="3">打分：</el-col>
                <el-col :span="21">
                    <div>
                        <div style="min-height: 100px" v-if="user.roleCode!=='TOWN_REVIEWER'">
                            <div v-for="(item,index) in diaTownList" :class="diaTownIndex==index?'townBtnActive':'townBtn'" >
                                <div @click="getScore(secondIndex.quotaId,index,item.districtId)">{{item.districtName}}</div>
                            </div>
                        </div>
                    </div>
                    <!--监测指标-->
                    <div v-if="tabLabel=='监测指标'" class="loadDiv" v-loading="scoreLoad">
                        <div v-for="item in scoreList" class="allCunScore" >
                            <div>{{item.districtName}}</div>
                            <!--村集体经济收入-->
                            <div v-if="form.quotaId&&form.quotaId.indexOf('0301')!=-1">
                                <div>
                                    <div class="indexLabel">本年度村集体经济收入</div>
                                    <div class="indexValue">
                                        <el-input type="number" v-model="item.currentYearEconomicIncome" :disabled="diaDisabled"></el-input>
                                    </div>
                                </div>
                                <div>
                                    <div class="indexLabel">本年度村集体经济收（全口径）</div>
                                    <div class="indexValue">
                                        <el-input type="number" v-model="item.economicIncome" :disabled="diaDisabled"></el-input>
                                    </div>
                                </div>
                                <div>
                                    <div class="indexLabel">上年度村集体经济收入</div>
                                    <div class="indexValue">
                                        <el-input type="number" v-model="item.lastYearEconomicIncome" :disabled="diaDisabled"></el-input>
                                    </div>
                                </div>
                                <div>
                                    <div class="indexLabel">年度村集体经济收入佐证</div>
                                    <div class="indexValue">
                                        <FileUpload :value="item.incomeSupportDoc" @getValue="item.incomeSupportDoc = $event" style="width: 150px;" :disabled="diaDisabled"></FileUpload>
                                    </div>
                                </div>
                            </div>
                            <!--农村人居环境-->
                            <div v-if="form.quotaId&&form.quotaId.indexOf('0305')!=-1">
                                <div>
                                    <div class="indexLabel">人居环境是否通过检查</div>
                                    <div class="indexValue">
                                        <el-input v-model="item.hasPass" :disabled="diaDisabled"></el-input>
                                    </div>
                                </div>
                                <div>
                                    <div class="indexLabel">人居佐证</div>
                                    <div class="indexValue">
                                        <FileUpload :value="item.environmentSupportDoc" @getValue="item.environmentSupportDoc = $event" style="width: 150px;" :disabled="diaDisabled"></FileUpload>
                                    </div>
                                </div>
                            </div>
                            <!--组织生活-->
                            <div v-if="form.quotaId&&form.quotaId.indexOf('0302')!=-1">
                                <div>
                                    <div class="indexLabel">组织生活任务完成率</div>
                                    <div class="indexValue">
                                        <el-input v-model="item.partyActivityFinishRatio" :disabled="diaDisabled"></el-input>
                                    </div>
                                </div>
                                <div>
                                    <div class="indexLabel">村干部员额数量</div>
                                    <div class="indexValue">
                                        <el-input type="number" v-model="item.cadrePosts" :disabled="diaDisabled"></el-input>
                                    </div>
                                </div>
                                <div>
                                    <div class="indexLabel">挂牌清理完成率</div>
                                    <div class="indexValue">
                                        <el-input v-model="item.cleanFinishRatio" :disabled="diaDisabled"></el-input>
                                    </div>
                                </div>
                                <div>
                                    <div class="indexLabel">村干部35周岁以下</div>
                                    <div class="indexValue">
                                        <el-input type="number" v-model="item.cadreBelowThirtyFive" :disabled="diaDisabled"></el-input>
                                    </div>
                                </div>
                                <div>
                                    <div class="indexLabel">村干部35周岁到50周岁</div>
                                    <div class="indexValue">
                                        <el-input type="number" v-model="item.cadreBetweenThirtyFiveToFifty" :disabled="diaDisabled"></el-input>
                                    </div>
                                </div>
                                <div>
                                    <div class="indexLabel">村干部超过50周岁</div>
                                    <div class="indexValue">
                                        <el-input type="number" v-model="item.cadreOverFifty" :disabled="diaDisabled"></el-input>
                                    </div>
                                </div>
                            </div>
                            <!--为民实事工程-->
                            <div v-if="form.quotaId&&form.quotaId.indexOf('0304')!=-1">
                                <div>
                                    <div class="indexLabel">为民实事工程总额</div>
                                    <div class="indexValue">
                                        <el-input type="number" v-model="item.projectAmount" :disabled="diaDisabled"></el-input>
                                    </div>
                                </div>
                                <div>
                                    <div class="indexLabel">总额佐证材料</div>
                                    <div class="indexValue">
                                        <FileUpload :value="item.projectAmountSupportDoc" @getValue="item.projectAmountSupportDoc = $event" style="width: 150px;" :disabled="diaDisabled"></FileUpload>
                                    </div>
                                </div>
                            </div>
                            <!--信访-->
                            <div v-if="form.quotaId&&form.quotaId.indexOf('0303')!=-1">
                                <div>
                                    <div class="indexLabel">常驻人口</div>
                                    <div class="indexValue">
                                        <el-input type="number" v-model="item.population" :disabled="diaDisabled"></el-input>
                                    </div>
                                </div>
                                <div>
                                    <div class="indexLabel">村级信访量</div>
                                    <div class="indexValue">
                                        <el-input type="number" v-model="item.petitionLetterAmount" :disabled="diaDisabled"></el-input>
                                    </div>
                                </div>
                                <div>
                                    <div class="indexLabel">越级信访量</div>
                                    <div class="indexValue">
                                        <el-input type="number" v-model="item.skipPetitionLetterAmount" :disabled="diaDisabled"></el-input>
                                    </div>
                                </div>
                                <div>
                                    <div class="indexLabel">信访化解量</div>
                                    <div class="indexValue">
                                        <el-input type="number" v-model="item.defusePetitionLetterAmount" :disabled="diaDisabled"></el-input>
                                    </div>
                                </div>
                                <div>
                                    <div class="indexLabel">信访佐证材料</div>
                                    <div class="indexValue">
                                        <FileUpload :value="item.petitionLetterSupportDoc" @getValue="item.petitionLetterSupportDoc = $event" style="width: 150px;" :disabled="diaDisabled"></FileUpload>
                                    </div>
                                </div>
                            </div>
                            <div>
                                <div class="indexLabel">{{form.quotaName}}</div>
                                <div class="indexValue">
                                    <el-input type="number" v-model="item.score" :disabled="diaDisabled"></el-input>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!--综合评议-->
                    <div v-else-if="tabLabel=='综合评议'" class="loadDiv" v-loading="scoreLoad">
                        <div v-for="item in scoreList" class="allCunScore" >
                            <div>{{item.districtName}}</div>
                            <div class="tableContent"  v-if="item.kpiEvaluations.length>0">
                                <h4 style="text-align: center;" class="tableBorder">{{tableName}}</h4>
                                <div style="display: flex">
                                    <div class="tableResult">序号</div>
                                    <div style="flex: 2" class="tableBorder">项目</div>
                                    <!--表头不一样 0403党员群众-->
                                    <div style="flex: 4;" v-if="form.quotaId&&form.quotaId.indexOf('0503')!=-1">
                                        <div class="tableBorder">满意度</div>
                                        <div style="display: flex">
                                            <div class="tableResult">满意</div>
                                            <div class="tableResult">比较满意</div>
                                            <div class="tableResult">基本满意</div>
                                            <div class="tableResult">不满意</div>
                                        </div>
                                    </div>
                                    <div style="flex: 4;" v-else>
                                        <div class="tableBorder">评议等次</div>
                                        <div style="display: flex">
                                            <div class="tableResult">好</div>
                                            <div class="tableResult">较好</div>
                                            <div class="tableResult">一般</div>
                                            <div class="tableResult">弱</div>
                                        </div>
                                    </div>
                                </div>
                                <div v-for="(sub,subIndex) in item.kpiEvaluations" style="display: flex" v-if="subIndex<5">
                                    <div class="tableResult">{{sub.indexNum}}</div>
                                    <div style="flex: 2" class="tableBorder">{{sub.commentProject}}</div>
                                    <div class="tableResult">
                                        <el-input v-model="sub.good" :disabled="diaDisabled"></el-input>
                                    </div>
                                    <div class="tableResult">
                                        <el-input v-model="sub.preferably" :disabled="diaDisabled"></el-input>
                                    </div>
                                    <div class="tableResult">
                                        <el-input v-model="sub.commonly" :disabled="diaDisabled"></el-input>
                                    </div>
                                    <div class="tableResult">
                                        <el-input v-model="sub.bad" :disabled="diaDisabled"></el-input>
                                    </div>
                                </div>
                                <div style="display: flex">
                                    <!--表头不一样-->
                                    <div style="flex:3" class="tableBorder" v-if="form.quotaId&&form.quotaId.indexOf('0502')!=-1">总体评价</div>
                                    <div style="flex:3" class="tableBorder" v-else>综合评议</div>
                                    <div style="flex:4">
                                        <div style="display: flex" v-if="form.quotaId&&form.quotaId.indexOf('0502')!=-1">
                                            <div class="tableResult">满意</div>
                                            <div class="tableResult">比较满意</div>
                                            <div class="tableResult">基本满意</div>
                                            <div class="tableResult">不满意</div>
                                        </div>
                                        <div style="display: flex" v-else>
                                            <div class="tableResult">优秀</div>
                                            <div class="tableResult">称职</div>
                                            <div class="tableResult">基本称职</div>
                                            <div class="tableResult">不称职</div>
                                        </div>
                                        <div style="display: flex">
                                            <div class="tableResult">
                                                <el-input v-model="item.kpiEvaluations[5].good" :disabled="diaDisabled"></el-input>
                                            </div>
                                            <div class="tableResult">
                                                <el-input v-model="item.kpiEvaluations[5].preferably" :disabled="diaDisabled"></el-input>
                                            </div>
                                            <div class="tableResult">
                                                <el-input v-model="item.kpiEvaluations[5].commonly" :disabled="diaDisabled"></el-input>
                                            </div>
                                            <div class="tableResult">
                                                <el-input v-model="item.kpiEvaluations[5].bad" :disabled="diaDisabled"></el-input>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div>
                                <div>
                                    <div class="indexLabel">{{form.quotaName}}</div>
                                    <div class="indexValue">
                                        <el-input type="number" v-model="item.score" :disabled="diaDisabled"></el-input>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!--素能评价-->
                    <div v-else-if="tabLabel=='素能评价'" class="loadDiv" v-loading="scoreLoad">
                        <div v-for="item in scoreList" class="allCunScore" >
                            <div>{{item.districtName}}</div>
                            <!-- <div v-if="form.parentQuotaId&&form.parentQuotaId.indexOf('0402')!=-1">
                                <div>
                                    <div class="indexLabel">附件佐证材料</div>
                                    <div class="indexValue">
                                        <FileUpload :value="item.judgeSupportDoc" @getValue="item.judgeSupportDoc = $event" style="width: 150px;" :disabled="diaDisabled"></FileUpload>
                                    </div>
                                </div>
                            </div> -->
                            <div>
                                <div class="indexLabel">{{form.quotaName}}</div>
                                <div class="indexValue">
                                    <el-input type="number" v-model="item.score" :disabled="diaDisabled"></el-input>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!--其他指标-->
                    <div v-else  class="loadDiv" v-loading="scoreLoad">
                        <div v-for="item in scoreList" class="weightInput">
                            <div>{{item.districtName}}</div>
                            <el-input type="number" v-model="item.score" :disabled="diaDisabled"></el-input>
                        </div>
                    </div>
                </el-col>
            </div>
            <div style="clear: both;text-align: right">
                <el-button type="success"  size="medium" :loading="saveBtnLoad" @click="saveScore()" v-if="user.roleCode!=='TOWN_REVIEWER'&&!diaDisabled">保存</el-button>
                <el-button type="primary"  size="medium" :loading="submitLoad" @click="submitScore()" v-if="!diaDisabled">提交</el-button>
                <el-button size="medium" @click="handClose">{{diaDisabled?'关闭':'取消'}}</el-button>
            </div>
        </el-dialog>
    </section>
</template>

<script>
    import PendingTask from "@/components/PendingTask";
    import FileUpload from '@/components/FileUpLoad';
    import MarkeIndex from "./markeIndex";
    export default {
        name: "IndexScore",
        data(){
            return{
                indexList:[],
                indexDataList:[],
                diaTitle:'',
                diaVis:false,
                form:{},
                villageList:[],
                user:{},
                submitLoad:false,
                secondIndex:{},
                pageLoad:false,
                activeTab:'',
                cardLoad:false,
                initCun:[],
                currentObject:{},
                scoreList:[],
                tabLabel:'',
                diaTownList:[],
                scoreLoad:false,
                diaTownIndex:'',
                saveBtnLoad:false,
                tableInit:[
                    {
                        indexNum:1,
                        commentProject:'政治作为',
                        commentContent : '严守政治纪律，恪守政治规矩，做到拥护党的决定，对党忠诚;坚决执行上级党委各项决策部署;做到关键时刻顶得上、豁得出;主动加强政治学习和政治历练、积累政治经验。',
                        good : 0,
                        preferably : 0,
                        commonly : 0,
                        bad : 0,

                    },
                    {
                        indexNum:2,
                        commentProject:'发展实绩',
                        CommentContent : '千方百计发展壮大村集体经济;主动带领群众增收致富;大力推进农业产业发展;全心全意为群众办实事;积极改善村庄生产生活环境。',
                        good : 0,
                        preferably : 0,
                        commonly : 0,
                        bad : 0,

                    },
                    {
                        indexNum:3,
                        commentProject:'管理成效',
                        commentContent : '把队伍建设放在突出位置，村两委班子团结、战斗力强、作风优良;管理成效村党员队伍纯洁、风清气正、积极向上;村能人队伍管理有效、帮扶有力。',
                        good : 0,
                        preferably : 0,
                        commonly : 0,
                        bad : 0,

                    },
                    {
                        indexNum:4,
                        commentProject:'治理能力',
                        commentContent : '及时有效处理村级矛盾，做到小事不出村、大事不出镇;严格实行“四理能力议两公开”;积极改善和保障民生;倡导社会主，义精神文明;推进乡村法治建设，提升乡村德治水平。' ,
                        good : 0,
                        preferably : 0,
                        commonly : 0,
                        bad : 0,

                    },
                    {
                        indexNum:5,
                        commentProject:'服务群众',
                        commentContent : '密切联系群众，解决实际问题和困难;积极维护群众正当权利和利益;承诺践诺赢得群众信任;关心困难群体，体现党的关怀。',
                        good : 0,
                        preferably : 0,
                        commonly : 0,
                        bad : 0,
                    },
                    {
                        indexNum:6,
                        commentProject:'综合评议',
                        commentContent : ' ' ,
                        good : 0,
                        preferably : 0,
                        commonly : 0,
                        bad : 0,
                    }
                ],
                tableName:'',
                townList:[],
                townIndex:'',
                currentTown:'',
                submitBtnLoading: false,
                diaDisabled:false,
                currentAttachment: {
                    address: '1111'
                },
                taskIndex: -1,
                isShowTaskDetail : true,
            }
        },
        methods:{
            showIndex(year,taskType,taskId){
                this.pageLoad = true;
                let param = {quotaYear:year,quotaLevel:'1',quotaScoringDepartId:this.user.districtId,
                    onceOrMore:taskType,taskId:taskId,districtId:this.user.districtId};
                this.$http('post',`identity/kpiQuota/list`, param, false).then(data=>{
                    this.indexList = data.reverse();
                    this.activeTab = this.indexList[0].quotaId;
                    this.tabLabel = this.indexList[0].quotaName;
                    this.showList(this.indexList[0].quotaId);
                    this.pageLoad = false;
                }).catch(()=>{
                    this.pageLoad = false;
                })
            },
            showList(quotaId){
                this.cardLoad = true;
                let param = {districtId:this.user.districtId, parentQuotaId: quotaId, isReviewOrMake: "1",
                    quarter: this.currentObject.taskQuarter,taskId:this.currentObject.taskId};
                this.indexDataList = [];
                this.initCun = [];
                let isDepart = this.user.roleCode.indexOf('DEPART')>-1?'1':'0';
                this.$http('post',`identity/kPITownQuota/getAll?isDepart=${isDepart}&townDistrictId=${this.currentTown}`, param, false).then(data=>{
                    this.indexDataList = data;
                    this.initCun = data[0].kpiTownQuotas[0].kpiVillageQuotas;
                    this.cardLoad = false;
                }).catch(()=>{
                    this.cardLoad = false;
                })
            },
            handleTab(tab){
                this.tabLabel = this.indexList[tab.index].quotaName;
                if(this.user.roleCode!="TOWN_REVIEWER"){
                    this.currentTown = this.townList[0].districtId;
                    this.townIndex = 0;
                }
                this.showList(tab.name);
            },
            editScore(item,type){
                if(type=='edit'){
                    this.diaTitle = '打分';
                    this.diaDisabled = false;
                }else{
                    this.diaTitle = '打分详情';
                    this.diaDisabled = true;
                }
                this.secondIndex = item;
                this.currentAttachment = {address: ''};
                if (item) {
                    Object.assign(this.currentAttachment, item.attachment)
                }
                this.form = Object.assign({},item);
                this.diaVis = true;
                if(this.user.roleCode=='TOWN_REVIEWER'){
                    this.getScore(item.quotaId,0,this.user.districtId);
                }else{
                    this.showCurrentList(item);
                }
            },
            getScore(id,index,districtId){
                this.diaTownIndex = index;
                this.scoreLoad = true;
                let path = `identity/kPITownQuota/scoringBasic?townQuotaId=${id}&taskId=${this.currentObject.taskId}&districtId=${districtId}`;
                if (this.currentObject.taskType === '日常工作考核') {
                    path += `&quarter=${this.currentObject.taskQuarter}`;
                }
                this.$http('GET', path, false).then(data=>{
                    this.scoreList = data;
                    if(this.tabLabel=='综合评议'){
                        let type = '';
                        if(this.form.quotaName.indexOf('两委')!=-1){
                            type = 2 ;
                            this.tableName = "村“两委”干部综合评议表";
                        }else if(this.form.quotaName.indexOf('镇机关')!=-1){
                            type = 1 ;
                            this.tableName = "镇机关人员综合评议表";
                        }else if(this.form.quotaName.indexOf('党员群众')!=-1){
                            type = 3 ;
                            this.tableName = "党员群众满意度调查表";
                        }
                        this.scoreList.forEach(item=>{
                            if(item.kpiEvaluations.length==0){
                                item.kpiEvaluations = JSON.parse(JSON.stringify(this.tableInit));
                                item.kpiEvaluations.forEach(sub=>{
                                    sub.taskId = this.currentObject.taskId;
                                    sub.districtId = item.districtId;
                                    sub.type = type;
                                })
                            }
                        })
                    }
                    this.scoreLoad = false;
                }).catch(()=>{
                    this.scoreLoad = false;
                })
            },
            handClose(){
                this.diaVis = false;
                this.form = {};
            },
            saveScore(){
                this.saveBtnLoad = true;
                this.scoreLoad = true;
                this.$http('POST',`identity/kPIVillageQuota/scoring?taskId=${this.currentObject.taskId}`,this.scoreList,false).then(data=>{
                    this.$message({
                        type:'success',
                        message:'保存成功'
                    });
                    this.saveBtnLoad = false;
                    this.scoreLoad = false;
                }).catch(()=>{
                    this.saveBtnLoad = false;
                    this.scoreLoad = false;
                });
            },
            submitScore(){
                this.submitLoad = true;
                this.$http('POST',`identity/kPIVillageQuota/scoring?taskId=${this.currentObject.taskId}`,this.scoreList,false).then(data=>{
                    this.$message({
                        type:'success',
                        message:'打分成功！'
                    });
                    this.diaVis = false;
                    this.submitLoad = false;
                    this.form = {};
                    this.scoreList = [];
                    this.showList(this.activeTab);
                }).catch(()=>{
                    this.diaVis = false;
                    this.submitLoad = false;
                    this.form = {};
                });
            },
            /*执行任务*/
            getCurrentTask(data){
                this.currentObject = data;
                if(this.currentObject.status==0){
                    this.diaDisabled = false;
                }else{
                    this.diaDisabled = true;
                }
                let type = '';
                if(this.currentObject.taskType=='日常工作考核'){
                    type = '一年多次'
                }else{
                    type = '一年一次'
                }
                this.showIndex(this.currentObject.taskYear,type,this.currentObject.taskId);
            },
            getTaskIndex(taskIndex) {
                this.taskIndex = taskIndex;
                console.log(taskIndex, 'getTaskIndex');
            },
            submit(){
                this.submitBtnLoading = true;
                this.$confirm('确认提交该任务么, 是否继续?', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {
                    this.$http("GET", `/identity/cadreTaskObject/progressNext?taskObjectId=${this.currentObject.id}&isSuccess=SUCCESS`, false).then(data => {
                        this.submitBtnLoading = false;
                        this.currentObject = data;
                        this.isShowTaskDetail = false;
                        this.$refs.PendingTask.getTaskList();
                        this.$message({
                            type: 'success',
                            message: "提交成功！"
                        })
                    });
                }).catch(() => {
                    this.submitBtnLoading = false;
                });
            },
            showCurrentList(item){
                this.diaTownList = this.$store.state.towns;
                this.getScore(item.quotaId,0,this.diaTownList[0].districtId);
            },
            /*部门指标详情，显示对应镇的分数*/
            handleTown(districtId,index){
                this.currentTown = districtId;
                this.townIndex = index;
                this.showList(this.activeTab);
            },
            handleFile(data,item){
                let param = {
                    taskId: this.currentObject.taskId,
                    quotaId: this.secondIndex.quotaId,
                    quotaLevel: this.secondIndex.quotaLevel,
                    districtId: this.currentObject.objectId,
                    quarter: this.currentObject.taskQuarter,
                    address: data
                };
                this.$http('POST',`identity/kPIAttachment/`,param,false).then(data=>{
                    if (data) {
                        this.currentAttachment = data;
                    };
                }).catch(e => {
                    this.$message({
                        type: 'danger',
                        message: '文件实时保存失败，请联系系统管理员!'
                    })
                })
            }
        },
        components:{
            MarkeIndex,
            PendingTask,
            FileUpload,
        },
        mounted(){

        },
        created() {
            this.user = JSON.parse(sessionStorage.getItem('userInfo'));
            if(this.user.roleCode!="TOWN_REVIEWER"){
                this.townList = JSON.parse(sessionStorage.getItem('towns'));
                this.currentTown = this.townList[0].districtId;
                this.townIndex = 0;
            }

        }
    }
</script>

<style scoped >
    .indexScore {
        font-size: 16px;
        line-height: 30px;
        font-family:FZHei-B01S;
    }
    .indexScore .handleContent {
        min-height: 260px;
        margin: 30px 0;
    }
    .indexScore .singleIndex {
        float: left;
        border: 2px solid #43C089;
        width: 227px;
        height: 260px;
        margin: 0 7px 15px 0;
        border-radius: 5px;
    }
    .indexScore .secondTitle{
        width: 100%;
        background: #CFEFE1;
        line-height: 37px;
        height: 37px;
        font-weight: bolder;
        color: #4d4d4d;
        font-size: 14px;
        padding: 0 15px;
    }
    .indexScore .secondTitle:hover{
        background: #43C089;
        color: white;
    }
    .indexScore .thirdTitle{
        width: 100%;
        height: 37px;
        line-height: 37px;
        font-weight: bold;
        font-size: 14px;
        color: #919191;
        cursor: pointer;
        padding: 0 15px;
        background:rgba(246,255,251,1);
        border-bottom: 1px solid rgba(209,242,227,1);
    }
    .indexScore .resultContent{
        overflow: auto;
        white-space:nowrap;
        line-height: 45px;
        font-size: 16px;
        text-align: center;
        font-weight: bold;
        border-left: 2px solid #43C089;
        border-radius: 5px;
        margin:  30px 0;
    }
    .index_content_scroll {
        overflow: auto;
        height: 255px;
    }
    .indexScore .resultContent::-webkit-scrollbar-thumb,
    .index_content_scroll::-webkit-scrollbar-thumb {
        background-color: #5EC79E!important;
    }
    .indexScore .resultContent::-webkit-scrollbar  {
      height: 12px  /*滚动条高度*/
    }
    .indexScoreDia{
        font-weight: bold;
    }
   /* .indexScoreDia .otherInfo{
        max-height: 500px;
        overflow-y: scroll;
    }*/
    .indexScoreDia .allCunScore{
        clear: both;
        border-bottom: 1px solid darkgray;
        margin-top: 15px;
    }
    .townBtn{
        float: left;
        margin: 5px;
        border: #d3d4d6 1px solid;
        background: #f4f4f5;
        color: #909399;
        padding: 2px 15px;
        font-size: 14px;
        border-radius: 5px;
    }
    .townBtn:hover{
        cursor: pointer;
    }
    .indexScoreDia .loadDiv{
        clear: both;
        min-height: 300px;
    }
    .townBtnActive{
        float: left;
        margin: 5px;
        border: #51bf75 1px solid;
        background: #0fbb49;
        color: white;
        font-size: 14px;
        padding: 2px 15px;
        border-radius: 5px;
    }
    .townBtnActive:hover{
        cursor: pointer;
    }
    .indexScoreDia .indexLabel{
        display: inline-block;
        font-size: 16px;
        width: 190px;
    }
    .indexScoreDia .indexValue{
        display: inline-block;
        width: 80px;
    }
    .indexScoreDia .weightInput{
        display: inline-block;
        min-width: 100px;
        margin: 5px 10px;
    }
    .indexScore .resultBorder{
        border-right:1px solid #CFEFE1;
        border-bottom:1px solid #CFEFE1
    }
    .indexScore .lastResultBorder{
        border-right:1px solid #CFEFE1;
    }
    .indexScore .outDiv{
        float: left;
        border-top: 2px solid #43C089;
        border-bottom: 2px solid #43C089;
        border-right: 1px solid #43C089;
        border-radius: 5px;
    }
    .indexScore .twoIndex{
        width: 200px;
        display: inline-block;
    }
    .indexScore .thirdIndex{
        width: 350px;
        display: inline-block;
    }
    .indexScore .scoreIndex{
        width: 60px;
        display: inline-block;
        color: #FB2626;
        margin-left: -4px;
    }
    .indexScore .cunDetail{
        width: 100px;
        display: inline-block;
        color: #43C089;
    }
    .indexScoreDia .tableContent{
        width: 581px;
        border-left: 1px solid #EBEEF5;
        border-top: 1px solid #EBEEF5;
        text-align: center;
    }
    .indexScoreDia .tableResult{
        flex: 1;
        border-right: 1px solid #EBEEF5;
        border-bottom: 1px solid #EBEEF5;
    }
    .indexScoreDia .tableBorder{
        border-right: 1px solid #EBEEF5;
        border-bottom: 1px solid #EBEEF5;
    }
    .indexScore .titleLeftIcon{
        clear: both;
        margin: 10px 0;
        width: 140px;
        font-size: 18px;
        font-weight: bold;
        text-align: left;
        border-left: 2px solid #45A14F;
        padding-left: 10px;
        height: 18px;
        line-height: 18px;
        color: #393939;
    }
    .indexScore .scoreDiv{
        padding: 10px 15px;
        border: 1px rgba(10, 155, 26, 1) solid;
        border-top: none;
        border-radius: 0 0 5px 5px;
        background: #FFFFFF;
    }
    .indexScore .statusDiv{
        float: left;
        font-weight: bold;
        margin-right: 16px;
        height: 42px;
        font-size: 14px;
        padding: 1px 37px;
    }
    .indexScore .statusButtonDiv{
        margin: 20px 0px;
        height: 42px;
    }
    .indexScore .statusSubmit{
        height: 42px;
        float: left;
        width: 104px;
        font-size: 16px;
        background: #55BD94;
        color: #FFFFFF;
        border-radius: 5px;
    }

</style>
<style>
    .indexScoreDia  .el-input--mini .el-input__inner{
        width: 80px!important;
    }
    .indexScoreDia .el-dialog__body{
        font-size: 16px;
        line-height: 35px;
    }
    .indexScore .el-tabs--card>.el-tabs__header{
        border-bottom: 2px solid #0A9B1A;
        background: transparent!important;
        margin-top: 5px;
    }
    .indexScore .el-tabs--card>.el-tabs__header .el-tabs__item.is-active{
        border-radius: 5px 5px 0 0 ;
        line-height: 32px;
        height: 32px;
        background: #0A9B1A!important;
        color: white;
        margin: 0;
    }
    .indexScore .el-tabs--card>.el-tabs__header .el-tabs__item{
        border-right: none!important;
        border-left: none!important;
        color: #0A9B1A;
        height: 32px;
        line-height: 32px;
        font-size: 14px;
        margin: 0;
    }
    .indexScore .el-tabs__item:not(.is-active):hover {
        color: #0a9b1a !important;
    }
</style>
